package com.dlz.systemshop.utils;

import jakarta.servlet.http.HttpServletRequest;

public class ServerAddressUtil {
    // 获取 http:127.0.0.1:8080 (从 URL 中剔除 URI)
    public static String getURLExURI(HttpServletRequest request) {
        String requestURI = request.getRequestURI();
        String requestURL = String.valueOf(request.getRequestURL());
        int index = requestURL.indexOf(requestURI);
        return requestURL.substring(0, index + 1);
    }
}
